Skip to content

Kinematic and Dynamic Bicycle Models#3

Open
vvrs wants to merge 5 commits into
pathsim:mainfrom
vvrs:feat/bicycle-models
Open

Kinematic and Dynamic Bicycle Models#3
vvrs wants to merge 5 commits into
pathsim:mainfrom
vvrs:feat/bicycle-models

Conversation

@vvrs
Copy link
Copy Markdown

@vvrs vvrs commented May 18, 2026

Adds kinematic and dynamic bicycle vehicle models based on Kong, Pfeiffer, Schildbach, and Borrelli, "Kinematic and Dynamic Vehicle Models for Autonomous Driving Control Design", IEEE IV, 2015.

What's included

Blocks

  • KinematicBicycle 4-state model [x, y, ψ, v] with inputs [δ_f, a]. No tire model required, valid at all speeds including zero.
  • DynamicBicycle 6-state model [vx, vy, ψ, ψ̇, X, Y] using the standard linear 2-DOF lateral-yaw state-space formulation. Captures tire slip effects absent from the kinematic model.

Parameters

  • BicycleParameters (l_f, l_r) and DynamicBicycleParameters (adds m, I_z, C_af, C_ar)
  • hyundai_azera() factory for the paper's test vehicle

Constraints

  • BicycleConstraints dataclass with Table II bounds (steering angle/rate, acceleration/jerk)
  • clip_steering() and clip_acceleration() utility functions

Example

  • examples/example_lane_change.py — double lane change maneuver comparing both models at 15 m/s with a 2×2 plot grid (trajectory, heading, steering input, lateral displacement)

Tests

30 tests covering parameters, constraints, and both models (ODE RHS verification + full PathSim integration tests).

tests/test_parameters.py      — 8 tests
tests/test_constraints.py     — 10 tests
tests/test_kinematic_bicycle.py — 6 tests
tests/test_dynamic_bicycle.py  — 6 tests (includes low-speed safety check)

Dependencies

  • Pins pathsim>=0.20
  • Both blocks subclass pathsim.blocks.dynsys.DynamicalSystem, following the same pattern as pathsim-chem's CSTR block

Lane change Example in Pathview

image

vvrs added 5 commits May 18, 2026 18:27
Implement the two vehicle models from Kong et al. (IEEE IV 2015):

- KinematicBicycle: 4-state model [x, y, psi, v] with inputs
  [delta_f, a]. No tire model, valid at all speeds.
- DynamicBicycle: 6-state model [vx, vy, psi, psi_dot, X, Y]
  with linear tire forces. Low-speed slip angle guard.

Also adds:
- BicycleParameters / DynamicBicycleParameters dataclasses
- BicycleConstraints with Table II bounds from the paper
- hyundai_azera() factory for the paper's test vehicle
- Example notebook comparing both models (step steer)
- Pin pathsim>=0.20
- 30 tests passing

Ref: Kong, Pfeiffer, Schildbach, Borrelli, IEEE IV, 2015
- Use explicit 2-DOF lateral-yaw state-space form (A*x + B*u)
  instead of computing intermediate slip angles/forces which
  caused nonlinear divergence through Coriolis coupling
- Remove dvx = psi_dot*vy term (constant-speed assumption)
- Adjust C_af/C_ar to total axle stiffness convention (1/m not 2/m)
- Balance front/rear stiffness: C_af=126kN/rad, C_ar=80kN/rad
- Add double lane change example (examples/example_lane_change.py)
- 30 tests passing
- Point README and pyproject.toml URLs to github.com/vvrs/pathsim-vehicle
- Fix steering profile: use 2 sine cycles for proper double lane change
  (move to adjacent lane and return, net-zero lateral displacement)
- Extend simulation to 7s for full maneuver + settling
@vvrs vvrs changed the title Feat/bicycle models Kinematic and Dynamic Bicycle Models May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant